package com.bajie.bjlisten.entity;

import com.bajie.bjlisten.enums.UserSexEnum;
import com.bajie.bjlisten.enums.UserStateEnum;
import com.bajie.bjlisten.enums.User_typeEnum;
import com.bajie.bjlisten.enums.UserbasetypeEnum;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * 用户的实体
 */
@Data
@ToString
@Entity
@Table(name = "bj_user")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
public class BjUser {

    public BjUser() {

    }

    public BjUser(String username, String password, String salt, String name, User_typeEnum utype, String birthday, String userpic, UserSexEnum sex, String email, Long phone, String status, String weibo, String wechat, String zipcode, Integer fans_counts, Integer follew_counts, Integer receive_like_counts, UserStateEnum enablestate, UserbasetypeEnum user_base_type, String creator, String modifier, Date create_time, Date update_time) {

        this.username = username;
        this.password = password;
        this.salt = salt;
        this.name = name;
        this.utype = utype;
        this.birthday = birthday;
        this.userpic = userpic;
        this.sex = sex;
        this.email = email;
        this.phone = phone;
        this.status = status;
        this.weibo = weibo;
        this.wechat = wechat;
        this.zipcode = zipcode;

        this.fans_counts = fans_counts;
        this.follew_counts = follew_counts;
        this.receive_like_counts = receive_like_counts;
        this.enablestate = enablestate;
        this.user_base_type = user_base_type;
        this.creator = creator;
        this.modifier = modifier;
        this.create_time = create_time;
        this.update_time = update_time;
    }

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(length = 32)
    private String id;
    private String username;
    private String password;
    private String salt;
    private String name;
    //用户类型:0=普通用户，1=管理员
    private User_typeEnum utype;


    private String birthday;
    private String userpic;

    private UserSexEnum sex;
    private String email;
    private Long phone;
    private String status;//暂时不用这字段
    @Column(name = "weibo")
    private String weibo;
    @Column(name = "wechat")
    private String wechat;
    @Column(name = "zipcode")
    private String zipcode;
    private Date create_time;

    private Date update_time;
    private Integer fans_counts;//邀请数
    private Integer follew_counts;
    private Integer receive_like_counts;
    //0:正常状态1:创建未认证（比如没有激活，没有输入验证码等等,默认登录游客）--等待验证的用户2：用户被锁定
    private UserStateEnum enablestate;
    //0=员工、1=居间、2=代理、3=客服
    private UserbasetypeEnum user_base_type;
    private String creator;
    private String modifier;//最后修改人
    private String age;
    private String city;
    private String openid;
    private String imei;
    private String appunique;


}
